drop trigger "CompoundDeleteTrigger_cc_multi"
/

drop trigger "CompoundInsertTrigger_cc_multi"
/

drop trigger "CompoundUpdateTrigger_cc_multi"
/

drop trigger "tib_cc_multiprovider"
/

drop table CC_MULTIPROVIDER cascade constraints
/

/*==============================================================*/
/* Table: CC_MULTIPROVIDER                                      */
/*==============================================================*/
create table CC_MULTIPROVIDER 
(
   ID                   NUMBER               not null,
   PROVIDERID           NUMBER,
   PROVIDERNAME         VARCHAR(128),
   OPERATION            VARCHAR(64),
   OOPATH               VARCHAR(512),
   ENVIRONMENT          VARCHAR(64),
   constraint PK_CC_MULTIPROVIDER primary key (ID)
)
/


create or replace trigger "CompoundDeleteTrigger_cc_multi"
for delete on CC_MULTIPROVIDER compound trigger
// Declaration
// Body
  before statement is
  begin
     NULL;
  end before statement;

  before each row is
  begin
     NULL;
  end before each row;

  after each row is
  begin
     NULL;
  end after each row;

  after statement is
  begin
     NULL;
  end after statement;

END
/


create or replace trigger "CompoundInsertTrigger_cc_multi"
for insert on CC_MULTIPROVIDER compound trigger
// Declaration
// Body
  before statement is
  begin
     NULL;
  end before statement;

  before each row is
  begin
     NULL;
  end before each row;

  after each row is
  begin
     NULL;
  end after each row;

  after statement is
  begin
     NULL;
  end after statement;

END
/


create or replace trigger "CompoundUpdateTrigger_cc_multi"
for update on CC_MULTIPROVIDER compound trigger
// Declaration
// Body
  before statement is
  begin
     NULL;
  end before statement;

  before each row is
  begin
     NULL;
  end before each row;

  after each row is
  begin
     NULL;
  end after each row;

  after statement is
  begin
     NULL;
  end after statement;

END
/


create trigger "tib_cc_multiprovider" before insert
on CC_MULTIPROVIDER for each row
declare
    integrity_error  exception;
    errno            integer;
    errmsg           char(200);
    dummy            integer;
    found            boolean;

begin
    --  Column "ID" uses sequence MULTIPROVIDERID
    select MULTIPROVIDERID.NEXTVAL INTO :new.ID from dual;

--  Errors handling
exception
    when integrity_error then
       raise_application_error(errno, errmsg);
end;
/
